﻿<!DOCTYPE html>
<html>

<head>
	<meta charset="UTF-8">
	<title>代理商管理</title>
	<link rel="stylesheet" href="css/common2.css">
	<link rel="stylesheet" href="css/urlty.css">

</head>

<body>
	<div id="vue-root" style="margin-top: 20px;">
		<div class="search_box" style="margin-top: 40px;">
			<div class="add" @click="add" style="width:120px;background-size: 130px 35px;">
				<a href="agent_item.html" style="color: white;">添加代理商</a>
			</div>
			<div class="refresh" onclick="location.reload()">刷新</div>

		</div>

		<div>
			<div class="table">
				<table class="table_top">
					<thead>
						<tr>
							<th class="two">
								<input type="checkbox" class="check-box" v-model="all">
							</th>
							<th>序号</th>
							<th class="two">代理商</th>
							<!-- <th class="four">联系人</th>
							<th class="two">联系方式</th> -->
							<th class="four">用户名</th>

							<th class="two">进入代理商</th>
							<th class="two">权限设置</th>
							<th class="three">编辑/删除</th>
						</tr>
					</thead>
					<tbody id="list">
						<tr v-for="(agent,index) in list" :key="agent.id">
							<td class="two">
								<input type="checkbox" class="check-box" v-model="agent.checked">
							</td>
							<td><span v-text="index+1"></span></td>
							<td class="two" v-text="agent.name"></td>
							<!-- <td class="four" v-text="agent.linkman"></td>
							<td class="two" v-text="agent.contactInfo"></td> -->
							<td class="four" v-text="agent.username"></td>

							<td class="two"><button class="hut_but_tz" @click="enter(agent.id)">进入代理商</button></td>
							<td class="two">
								<a :href="'authority_item2.html?type=agent&id='+agent.id">
									<button class="hut_but_tz">代理商权限</button>
								</a>
								<a :href="'authority_item.html?type=agent&id='+agent.id" style="margin-left: 5px;">
									<button class="hut_but_tz">学校权限</button>
								</a>
							</td>
							<td class="three">
								<div class="option">
									<div class="edit-icon option-icon" @click="edit(agent.id)"
										style="position: absolute; left: 20%; top: 30%;">
										<img class="img" src="../image/edit.png" height="20" width="20"
											onmouseover="this.src='image/edit_light.png'"
											onmouseout="this.src='image/edit.png'" />
									</div>
									<div class="delete-icon option-icon" @click="del([agent.id])"
										style="right: 20%; top:30%;position: absolute;">
										<img class="img" src="../image/delete.png" height="20" width="20"
											onmouseover="this.src='image/delete_light.png'"
											onmouseout="this.src='image/delete.png'" />
									</div>
								</div>
							</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		<div class="delete" @click="batchDelete" v-if="total>1">批量删除</div>
		<ul class="pagination" v-if="pages>1">
			<li>
				<a v-if="pageNum!=1" @click="pageNum=1">«</a>
				<a class="pages-jump" v-if="pageNum!=1" @click="pageNum--">‹</a>
				<a v-text="pageNum"></a>
				<a class="pages-jump" v-if="pageNum!=pages" @click="pageNum++">›</a>
				<a v-if="pageNum!=pages" @click="pageNum=pages">»</a>
			</li>
		</ul>
		<div style="float: right;">
			总共{{total}}条记录
			<select class="ui-select init" style="height:32px" v-model="pageSize">
				<option :value="10">每页10条</option>
				<option :value="30">每页30条</option>
				<option :value="100">每页100条</option>
			</select>
		</div>
	</div>

	<script src="/scriptZIP/vue.min.js"></script>
	<script src="/scriptZIP/axios.min.js"></script>

	<script src="/js/common.js"></script>
	<script src="/js/list.js"></script>

	<script>

		var app = new Vue(merge({
			data: {
				isWQ: false,
				urls: {
					list: '/pc/agent/list',
					del: '/pc/agent/del'
				}
			},
			methods: {

				enter: function (id) {
					open("/agent/agent_menu.html?id=" + id, '_blank');
				},
				edit: function (id) {
					location.href = "agent_item.html?id=" + id;
				},
				add: function () {
					location.href = "agent_item.html";
				}
			},

		}));
	</script>


</body>

</html>